import java.util.Scanner;

public class PrintRecursion {
    public static void PrintR(int a) {
        if (a < 0) {
            System.out.print("-");
            a = -a;
        }
        if (a < 10) {
            System.out.print(a);
        } else {
            PrintR(a / 10);
            System.out.print(a % 10);
        }
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int ret = scanner.nextInt();
        PrintR(ret);
    }
}
/*public class PrintRecursion {
        public static void printDigits(int number) {
            // 处理负数情况
            if (number < 0) {
                System.out.print("- ");
                number = -number;
            }

            // 基本情况：当数字只有一位时
            if (number < 10) {
                System.out.print(number + " ");
            }
            // 递归情况：数字有多位
            else {
                printDigits(number / 10);  // 递归调用，去掉最后一位
                System.out.print(number % 10 + " ");  // 打印最后一位
            }
        }

        public static void main(String[] args) {
            int num = 12345;
            System.out.print("数字 " + num + " 的每一位是: ");
            printDigits(num);

            System.out.println();  // 换行

            num = -6789;
            System.out.print("数字 " + num + " 的每一位是: ");
            printDigits(num);
        }
    }*/
